package com.ruoyi.eam.controller;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.eam.doman.Dept;
import com.ruoyi.eam.service.IDeptService;
import com.ruoyi.eam.service.IUserService;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/depts")
public class DeptController extends BaseController {

    @Autowired
    private IDeptService iDeptService;

    @GetMapping(value = "/{deptId}")
    public AjaxResult getInfo(@PathVariable("deptId") Long deptId)
    {
        return success(iDeptService.selectDeptByDeptId(deptId));
    }

    @GetMapping("/list")
    public AjaxResult selectDeptList(Dept dept){
        return success(iDeptService.selectDeptList(dept));
    }
}
